﻿<%@ Page Title="" Language="C#" MasterPageFile="~/Views/Shared/Site.Master" Inherits="System.Web.Mvc.ViewPage<dynamic>" %>

<asp:Content ID="Content1" ContentPlaceHolderID="MainContent" runat="server">


<!--系列图书推荐-->
<div class="act_list w_980 clearfix">
	<!--left-->
	<div class="act_left">
        <!--title-->
        <div class="info_box_title">
            <h3>系列图书推荐</h3>
            <p><a href="/index.html">首页</a>&gt;<span>系列图书推荐</span></p>
        </div>
        <div class="book_rec_list">

        <%
            BIZ.InfomationPublishOper ipo = new BIZ.InfomationPublishOper();
            int pageno = Request["pageno"] == null ? 1 : int.Parse(Request["pageno"].ToString());//当前页
            int pagesize = 8;//单页记录数
            int count = 0;//总记录数
            int pageNumber = 0;//总页数
            IList ligg = ipo.getlistweb(pageno, pagesize, (int)DAL.Enums.template.系列图书推荐);
        %>
        <!--list-->
        <div class="book_rec_bottom clearfix">
        	<!--系列图书推荐-->
            <ul>
            <% 
                foreach (Hashtable tb in ligg)
                {
                    if (tb["total"] == null)
                    {
                        Response.Write("<li><a target=\"_blank\" href=\"/template/seriesdetail.html?i=" + (tb["i_id"] == null ? "" : tb["i_id"].ToString()) + "\"><img src=\"" + BIZ.StringTool.changeImgUrl((tb["i_imageUrl"] == null ? "" : tb["i_imageUrl"].ToString())) + "\" width=\"254\" height=\"79\" /><span>" + (tb["i_title0"] == null ? "" : tb["i_title0"].ToString()) + "</span></a></li>");
                    }
                    else
                        count = (tb["total"] == null ? 0 : int.Parse(tb["total"].ToString()));
                }
            %>
            </ul>
        </div>
        </div>
        <!--pager-->
        <div class="pager">
        <%
            pageNumber = ((count % pagesize) == 0 ? (count / pagesize) : ((count / pagesize) + 1));
            int start = pagesize * (pageno - 1) + 1;
            if (start < 0)
                start = 0;
            int end = (start + pagesize-1);
            if (pageno == pageNumber)
            {
                if ((count % pagesize) != 0)
                {
                    end = (start + (count % pagesize) - 1);
                }
            }
        %>
            <p class="left"><%=count%> 条记录，显示第 <%=start %> 条 - 第 <%=end %> 条记录</p>
            <p class="right"><a href="/template/series.html?pageno=1" title="首页" class="a1 a1_n"></a>
            <a href="/template/series.html?pageno=<%=(pageno==1?1:pageno-1) %>" title="上一页" class="a2"></a><span>第<b><%=pageno %></b>页/共 <%=pageNumber %> 页</span>
            <a href="/template/series.html?pageno=<%=(pageno==pageNumber?pageNumber:pageno+1) %>" title="下一页" class="a3"></a><a href="/template/series.html?pageno=<%=pageNumber %>" title="末页" class="a4"></a>
            <select id="sPage">
            <% 
                for (int k = 1; k <= pageNumber;k++ )
                    Response.Write("<option value=\"" + k.ToString() + "\">" + k.ToString() + "</option>");
            %>
            </select></p>
            <script type="text/javascript" language="javascript">
                $(function () {
                    $("#sPage").val(<%=pageno %>);
                    $("#sPage").change(function () {
                        window.location.href = "/template/series.html?pageno=" + $("#sPage").val();
                    });
                })
            </script>
        </div>
    </div>
	<!--right-->
    <div class="act_right">
    	<!--排行榜-->
     	<% 
            Html.RenderPartial("~/Views/Shared/saveRanking.ascx");
        %>
    	<!--活动公告-->
        <%
            Html.RenderPartial("~/Views/Shared/notice.ascx");
        %>
    </div>
</div>

</asp:Content>
